-
Notifications
You must be signed in to change notification settings - Fork 23
/
intro.tex
117 lines (101 loc) · 3.23 KB
/
intro.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
% Author: Victor Terron (c) 2014
% Email: `echo vt2rron1iaa32s | tr 132 @.e`
% License: CC BY-SA 4.0
\begin{frame}{Programación orientada a objetos}
\small
\begin{block}
{\centering Una cita apócrifa}
\centering
``Object-oriented programming is an exceptionally bad
idea which could only have originated in California''
[Edsger W. Dijkstra]
\end{block}
\begin{figure}
\centering
\includegraphics[height=4cm]{pics/dijkstra.jpg}
\end{figure}
\end{frame}
\begin{frame}{Programación orientada a objetos}
\small
\begin{block}
{\centering Lo que en realidad dijo}
\centering
``For those who have wondered: I don't think object-oriented
programming is a structuring paradigm that meets my standards of
elegance.'' [Edsger W. Dijkstra, 1999]
[\href{http://www.cs.utexas.edu/users/EWD/transcriptions/EWD12xx/EWD1284.html}
{\structure{Fuente}}]
\end{block}
\begin{figure}
\centering
\includegraphics[height=5cm]{pics/like-a-sir.png}
\end{figure}
\end{frame}
\begin{frame}{Programando clases en Python}
\begin{block}{}
\Large
\centering
El objetivo de esta charla es ayudarnos a hacer
\structure{idiomáticas} y \structure{elegantes} nuestras clases en
Python.
\end{block}
\begin{justify}
En mayor o menor medida todo el mundo usa programación orientada a
objetos, pero hay una serie de aspectos fundamentales que es
indispensable conocer para evitar que nuestro código sea
innecesariamente feo o complejo.
\end{justify}
\end{frame}
\begin{frame}{Nuestra reacción a veces}
\begin{figure}
\centering
\includegraphics[height=6cm]{pics/dont-want-to-live-on-this-planet.png}
\end{figure}
\end{frame}
\begin{frame}{Programando clases en Python}
\begin{alertblock}{}
\small
\centering
La premisa es que somos mínimamente familiares con los
\structure{conceptos básicos} de programación orientada a objetos,
y que hemos trabajado un poco con nuestras propias clases en
Python.
\end{alertblock}
\begin{figure}
\centering
\includegraphics[height=4cm]{pics/captain-obvious.jpg}
\end{figure}
\end{frame}
\begin{frame}{Un muy brevísimo repaso}
\small
\begin{block}{\centering Uno}
\centering
Llamamos \structure{clase} a la representación abstracta de un
concepto. Por ejemplo, 'perro', 'número entero' o 'servidor web'.
\end{block}
\begin{block}{\centering Dos}
\centering
Las clases se componen de \structure{atributos} y
\structure{métodos}.
\end{block}
\begin{block}{\centering Tres}
\centering
Un objeto es cada una de las instancias de una clase.
\end{block}
\end{frame}
\begin{frame}{Ejemplo: clase Perro}
\pythoncode[fontsize=\footnotesize]{intro.py}
\end{frame}
\begin{frame}{¡No os limitéis a escuchar!}
\begin{center}
No suele ser divertido escuchar a nadie hablar durante casi una
hora. Participad, intervenid, criticad, opinad. ¡Si digo algo que
no tiene ningún sentido, \structure{corregidme}!
\end{center}
\begin{block}{\centering Transparencias y código fuente en:}
\centering \url{https://vterron.xyz/classes}
\end{block}
\begin{center}
\small Erratas, correcciones, enlaces, ¡cualquier cosa!
\end{center}
\end{frame}